package myservlet.control;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;

public class HandleExit  extends HttpServlet{
	public void init(ServletConfig config) throws ServletException {
		super.init(config);
	}
	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		HttpSession session= req.getSession(true);
		session.invalidate();//销毁用户的session对象
		resp.sendRedirect("index.jsp");//返回到登录页面
	}
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
}
